//
//  OrderModel.h
//  DaJiang
//
//  Created by sally on 16/10/25.
//  Copyright © 2016年 jiniu. All rights reserved.
//

#import "AccountInterface.h"
#import "BussinessModel.h"
#import "TopicModel.h"

/**
 *  预约订单实体
 */
@class OrderData;
@interface OrderModel : BussinessModel

@property (nonatomic, strong) NSString *op_name;
@property (nonatomic, assign) NSInteger data_id;
@property (nonatomic, assign) NSInteger orderid;
@property (nonatomic, assign) NSInteger updated_at; //特定情况下，是取消时间
@property (nonatomic, strong) OrderData *op_data;
@property (nonatomic, strong) TopicModel *pro_topic;
@property (nonatomic, strong) UserModel *user;
@property (nonatomic, assign) NSInteger created_at;
//@property (nonatomic, assign) NSInteger uid;

//我约的行家
+ (void)queryMyOrderListWithCursor:(NSInteger)cursor
                              type:(OrderStatusType)type
                        completion:(void (^)(NSMutableArray *orderList))completion;

//约我的人
+ (void)queryExpertOrderListWithCursor:(NSInteger)cursor
                                  type:(OrderStatusType)type
                            completion:(void (^)(NSMutableArray *orderList))completion;

#pragma mark - 约见接口相关
#pragma mark - 普通用户端
//预约专家的一个话题
+ (void)bookOrderWithProTopicId:(NSInteger)proTopicId
                   proTopicName:(NSString *)proTopicName
                  proTopicPrice:(CGFloat)proTopicPrice
                         proUid:(NSInteger)proUid
                        problem:(NSString *)problem
                          intro:(NSString *)intro
                         proPic:(NSString *)proPic
                        proName:(NSString *)proName
                       proTitle:(NSString *)proTitle
                     completion:(void (^)(BOOL isSucceed))completion;

//确认付费
+ (void)surePayedWithConsultId:(NSInteger)consultId
                        proUid:(NSInteger)proUid
                     cashValue:(CGFloat)cashValue
                     topicName:(NSString *)topicName
                    completion:(void (^)(BOOL isSucceed))completion;

//用户选择专家有空时间
+ (void)chooseFreeWithFreeId:(NSInteger)freeId
                   consultId:(NSInteger)consultId
                    meetTime:(NSString *)meetTime
                     meetLoc:(NSString *)meetLoc
                  completion:(void (^)(BOOL isSucceed))completion;

//用户取消约见
+ (void)userCancelOrderWithReason:(NSString *)reason
                        consultId:(NSInteger)consultId
                       completion:(void (^)(BOOL isSucceed))completion;

//提醒专家
+ (void)remindExpertWithProUid:(NSInteger)proUid
                     consultId:(NSInteger)consultId
                    completion:(void (^)(BOOL isSucceed))completion;

//评价专家
+ (void)commentExpertWithComment:(NSString *)comment
                       topicName:(NSString *)topicName
                          proUid:(NSInteger)proUid
                        cmtValue:(NSInteger)cmtValue
                         topicId:(NSInteger)topicId
                       consultId:(NSInteger)consultId
                      completion:(void (^)(BOOL isSucceed))completion;

#pragma mark - 专家端
//专家取消约见
+ (void)expertCancelOrderWithConsultId:(NSInteger)consultId
                            completion:(void (^)(BOOL isSucceed))completion;

//专家接受约见
+ (void)expertConfirmOrderWithConsultId:(NSInteger)consultId
                             completion:(void (^)(BOOL isSucceed))completion;

//用户失约
+ (void)userMissedMeetWithConsultId:(NSInteger)consultId
                         completion:(void (^)(BOOL isSucceed))completion;

//专家确认已经见面
+ (void)hasBeenMeetWithConsultId:(NSInteger)consultId
                      completion:(void (^)(BOOL isSucceed))completion;

@end

@interface OrderData : BussinessModel

@property (nonatomic, strong) NSString *state_detail;      // book 用户预订 admin_pass 后台审核通过 admin_reject 后台审核拒绝 confirmed 专家确认可以见面 user_payed 用户已支付 has_been_met 用户已确认见面 commented 用户已评价 cancelled 用户取消见面 user_missed_meet 用户没有来（失约） pro_user_refused 专家取消
@property (nonatomic, strong) NSString *state_detail_desc; //状态描述，app转换
@property (nonatomic, assign) NSInteger pro_uid;
@property (nonatomic, strong) NSString *pro_user_pro_title;
@property (nonatomic, strong) NSString *self_intro; //关于我
@property (nonatomic, strong) NSString *pro_topic_name;
@property (nonatomic, assign) CGFloat pro_topic_price;
@property (nonatomic, strong) NSString *pro_user_name;
@property (nonatomic, strong) NSString *pro_user_profile_pic;
@property (nonatomic, strong) NSString *consulting_problem; //请教的问题
@property (nonatomic, strong) NSString *meet_location;
@property (nonatomic, strong) NSString *meet_time;
@property (nonatomic, assign) NSInteger remind_pro_user;  //0=未提醒过专家确认；1=已提醒专家确认
@property (nonatomic, strong) NSString *cancelled_reason; //取消原因
@property (nonatomic, assign) NSInteger cmt_value;        //评分
@property (nonatomic, strong) NSString *comment;          //评论

@end
